const mysql = require('mysql')
const sql = require('./sql.js')

var pool = mysql.createPool({
    host: 'localhost',
    user: 'root',
    password: '',
    database: 'blog',
    port: 3306,
    // timezone: 'SYSTEM',
    connectionLimit: 10
})


/* var queryAll = function (param1, param2) {
    pool.query(param1, [param2], (err, result) => {
        if (err) throw err;

        // console.log(result);
        pool.end()

    })
} */



/* pool.getConnection(function (err, connection) {
    if (err) throw err;
    connection.query(sql, (err, result) => {
        if (err) throw err;

        console.log(result);
        connection.destroy()
    })
}) */
/* module.exports = {
    queryAll
} */
module.exports = pool